#include "SequenceControlPanel.h"

#include <QAbstractListModel>

#include "ActionListController.h"
#include "ActionListView.h"

SequenceControlPanel::SequenceControlPanel( ActionListView &sequenceView,
                                            ActionListController & sequenceController,
                                            QAbstractListModel &sequenceModel,
                                            QObject *parent) :
   QObject(parent),
   m_sequenceView(sequenceView),
   m_sequenceController( sequenceController),
   m_sequenceModel(sequenceModel)
{
}

void SequenceControlPanel::onEditRequest()
{
   int currentActiveRow = m_sequenceController.activeItemRow();
   m_sequenceView.edit( m_sequenceModel.index( currentActiveRow));
}

void SequenceControlPanel::onDeleteRequest()
{
   int currentActiveRow = m_sequenceController.activeItemRow();
   m_sequenceModel.removeRow( currentActiveRow);
}


